#!/usr/bin/env python
#coding:utf-8

from url import handlers
from config import configs

import tornado.web
import os
import motor

db = motor.MotorClient().yao

setting = dict(
    template_path=os.path.join(os.path.dirname(__file__),"templates"),
    static_path=os.path.join(os.path.dirname(__file__),"static"),
    debug=True,
    cookie_secret="61oETzKXQAGaYdkL5gEmGeJJFuYh7EQnp2XdTP1o/Vo=",
    login_url="/login",
    # xsrf_cookies=True
    db=db,
    config=configs
    )

application = tornado.web.Application(
    handlers=handlers,
    **setting
    )
